//
//  XWThemeConfig.swift
//  XiaoweHealthy
//
//  Created by Riven on 2022/3/30.
//

import Foundation
import UIKit


var appDefaultStatusBarStye: UIStatusBarStyle {
    if #available(iOS 13.0, *) {
        return .darkContent
    } else {
        return .default
    }
}

// 主色调
let lightMainThemeColor = UIColor(hex: 0x007AFF)!
let darkMainThemeColor = lightMainThemeColor
var mainThemeColor: UIColor {
    if #available(iOS 13.0, *) {
        return UIColor(light: lightMainThemeColor, dark: darkMainThemeColor)
    } else {
        return lightMainThemeColor
    }
}

// 主背景色
let lightBgColor = UIColor.white
let darkBgColor = lightBgColor
var bgColor: UIColor {
    if #available(iOS 13.0, *) {
        return UIColor(light: lightBgColor, dark: darkBgColor)
    } else {
        return lightBgColor
    }
}

// 覆盖View的背景颜色
let lightCoverBgColor = UIColor(hex: 0x000000, transparency: 0.2)!
let darkCoverBgColor = lightCoverBgColor
var coverBgColor: UIColor {
    if #available(iOS 13.0, *) {
        return UIColor(light: lightCoverBgColor, dark: darkCoverBgColor)
    } else {
        return lightCoverBgColor
    }
}

// collectionview/tableview 的背景颜色
let lightCollectionBgColor = UIColor(hex: 0xF8F8F8)!
let darkCollectionBgColor = lightCollectionBgColor
var collectionBgColor: UIColor {
    if #available(iOS 13.0, *) {
        return UIColor(light: lightCollectionBgColor, dark: darkCollectionBgColor)
    } else {
        return lightCollectionBgColor
    }
}

// 内容的颜色
let lightContentBgColor = UIColor.white
let darkContentBgColor = lightContentBgColor
var contentBgColor: UIColor {
    if #available(iOS 13.0, *) {
        return UIColor(light: lightContentBgColor, dark: darkContentBgColor)
    } else {
        return lightContentBgColor
    }
}

// 主要文本颜色
let lightMajorTextColor = UIColor(hex: 0x000000, transparency: 0.9)!
let darkMajorTextColor = lightMajorTextColor
var majorTextColor: UIColor {
    if #available(iOS 13.0, *) {
        return UIColor(light: lightMajorTextColor, dark: darkMajorTextColor)
    } else {
        return lightMajorTextColor
    }
}

// 次要文本颜色
let lightMinorTextColor = UIColor(hex: 0x000000, transparency: 0.45)!
let darkMinorTextColor = lightMinorTextColor
var minorTextColor: UIColor {
    if #available(iOS 13.0, *) {
        return UIColor(light: lightMinorTextColor, dark: darkMinorTextColor)
    } else {
        return lightMinorTextColor
    }
}

// tableview 分割线颜色
let lightTableSeparatorColor = UIColor(hex: 0x000000, transparency: 0.08)!
let darkTableSeparatorColor = lightTableSeparatorColor
var tableSeparatorColor: UIColor {
    if #available(iOS 13.0, *) {
        return UIColor(light: lightTableSeparatorColor, dark: darkTableSeparatorColor)
    } else {
        return lightTableSeparatorColor
    }
}

// button 的背景色
let lightBtnBgColor = mainThemeColor
let darkBtnBgColor = lightBtnBgColor
var btnBgColor: UIColor {
    if #available(iOS 13.0, *) {
        return UIColor(light: lightBtnBgColor, dark: darkBtnBgColor)
    } else {
        return lightBtnBgColor
    }
}

let lightCancelBtnBgColor = UIColor(hex: 0xF3F3F3)!
let darkCancelBtnBgColor = lightCancelBtnBgColor
var cancelBtnBgColor: UIColor {
    if #available(iOS 13.0, *) {
        return UIColor(light: lightCancelBtnBgColor, dark: darkCancelBtnBgColor)
    } else {
        return lightCancelBtnBgColor
    }
}

// 不可用button的背景色
let lightBtnDisableBgColor = lightBtnBgColor.withAlphaComponent(0.15)
let darkBtnDisableBgColor = lightBtnDisableBgColor
var btnDisableBgColor: UIColor {
    if #available(iOS 13.0, *) {
        return UIColor(light: lightBtnDisableBgColor, dark: darkBtnDisableBgColor)
    } else {
        return lightBtnDisableBgColor
    }
}

// placeHolder text 颜色
let lightPlaceHolderTextColor = majorTextColor.withAlphaComponent(0.25)
let darkPlaceHolderTextColor = lightPlaceHolderTextColor
var placeHolderTextColor: UIColor {
    if #available(iOS 13.0, *) {
        return UIColor(light: lightPlaceHolderTextColor, dark: darkPlaceHolderTextColor)
    } else {
        return lightPlaceHolderTextColor
    }
}

var navTitleFont: UIFont {
    AppFont.harmonyOSSans(ofSize: 28, weight: .bold)
}
var navTitleColor: UIColor {
    majorTextColor
}

var navItemFontSize: CGFloat {
    16
}

// 左右颜色
let leftEarColor = mainThemeColor
let rightEarColor = UIColor(hex: 0xEE704B)!
